import { registerControlProvider } from '@ibiz-template/runtime';
import { App } from 'vue';
import { withInstall } from '@ibiz-template/vue3-util';
import { Control } from './control';
import { ControlPluginProvider } from './control.provider';

export const IBizControlPlugin = withInstall(Control, function (v: App) {
  v.component(Control.name, Control);
  // CUSTOM是插件类型，R9ControlPluginId是插件标识
  registerControlProvider(
    'CUSTOM_R9ControlPluginId',
    () => new ControlPluginProvider(),
  );
});

export default IBizControlPlugin;
